﻿using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using ZH.GPT.Infrastructures.Entities;

namespace ZH.GPT.Domains.ChatMessage.Request
{
    /// <summary>
    /// 获取消息
    /// </summary>
    public class ChatMessageQDTO
    {
        /// <summary>
        /// 页码
        /// </summary>
        [Required]
        public int PageIndex { get; set; }
        /// <summary>
        /// 页容量
        /// </summary>
        [Required]
        public int PageSize { get; set; }
        /// <summary>
        /// 搜索条件
        /// </summary>
        [Required]
        public ChatMessageSearchCriteria SearchCriteria { get; set; }
        /// <summary>
        /// ToString
        /// </summary>
        /// <returns></returns>
        public override string ToString() => JsonConvert.SerializeObject(this);
    }

    /// <summary>
    /// 搜索条件
    /// </summary>
    public class ChatMessageSearchCriteria
    {
        ///// <summary>
        ///// 用户id
        ///// </summary>
        //public string UserId { get; set; }
        /// <summary>
        /// 消息体id
        /// </summary>
        [Required]
        public string ChatId { get; set; }

        public MessageRole? Role { get; set; }
    }
}
